home *** CD-ROM | disk | FTP | other *** search
/ Treccani Italiana Di Scienze Lettere Ed Arti / [Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso / mac / data / menu_dvd.swf / scripts / __Packages / CAppendiceStyleManager.as < prev    next >
Text File  |  2007-11-07  |  3KB  |  79 lines

  1. class CAppendiceStyleManager extends AsBroadcaster
  2. {
  3.    function CAppendiceStyleManager(inBaseFont, inApiceFont, inPediceFont, inNormalSize, inSmallSize, inBigSize)
  4.    {
  5.       super();
  6.       this.mCurrentView = "normal";
  7.       this.mBaseFont = inBaseFont;
  8.       this.mApiceFont = inApiceFont;
  9.       this.mPediceFont = inPediceFont;
  10.       this.mNormalSize = inNormalSize;
  11.       this.mSmallSize = inSmallSize;
  12.       this.mBigSize = inBigSize;
  13.       this.mMargin = 16;
  14.       this.mPrintMargin = 28;
  15.       this.mMarginTitle = 0;
  16.       this.mPreviewMargin = 16;
  17.       this.mPreviewMarginTitle = 16;
  18.       this.mPreviewNormalSize = this.mNormalSize - 1;
  19.       this.mPreviewSmallSize = this.mSmallSize - 1;
  20.       this.mPreviewBigSize = this.mBigSize - 1;
  21.       this.mPrintSize = inNormalSize;
  22.       this.init();
  23.    }
  24.    function SetView(inView)
  25.    {
  26.       if(inView != this.mCurrentView)
  27.       {
  28.          this.mCurrentView = inView;
  29.          if(this.mCurrentView == "big")
  30.          {
  31.             this.initStyle(this.mCSS,this.mBigSize,this.mMargin,this.mMarginTitle);
  32.             this.initStyle(this.mPreviewCSS,this.mPreviewBigSize,this.mPreviewMargin,this.mPreviewMarginTitle);
  33.          }
  34.          else if(this.mCurrentView == "small")
  35.          {
  36.             this.initStyle(this.mCSS,this.mSmallSize,this.mMargin,this.mMarginTitle);
  37.             this.initStyle(this.mPreviewCSS,this.mPreviewSmallSize,this.mPreviewMargin,this.mPreviewMarginTitle);
  38.          }
  39.          else
  40.          {
  41.             this.initStyle(this.mCSS,this.mNormalSize,this.mMargin,this.mMarginTitle);
  42.             this.initStyle(this.mPreviewCSS,this.mPreviewNormalSize,this.mPreviewMargin,this.mPreviewMarginTitle);
  43.          }
  44.          trace("Setting new css" + inView);
  45.          this.broadcastMessage("onFontSizeChanged");
  46.       }
  47.    }
  48.    function init()
  49.    {
  50.       this.mCSS = new TextField.StyleSheet();
  51.       this.initStyle(this.mCSS,this.mNormalSize,this.mMargin,this.mMarginTitle);
  52.       this.mPrintCSS = new TextField.StyleSheet();
  53.       this.initStyle(this.mPrintCSS,this.mPrintSize,this.mPrintMargin,this.mPrintMargin);
  54.       this.mPreviewCSS = new TextField.StyleSheet();
  55.       this.initStyle(this.mPreviewCSS,this.mPreviewNormalSize,this.mPreviewMargin,this.mPreviewMarginTitle);
  56.       AsBroadcaster.initialize(this);
  57.       trace("USE_EMBEDDED_FONT = " + CAppendiceStyleManager.USE_EMBEDDED_FONT);
  58.       HtmlListboxCellRenderer.USE_EMBEDDED_FONT = CAppendiceStyleManager.USE_EMBEDDED_FONT;
  59.       HtmlTreeCellRenderer.USE_EMBEDDED_FONT = CAppendiceStyleManager.USE_EMBEDDED_FONT;
  60.       HtmlMenuCellRenderer.USE_EMBEDDED_FONT = CAppendiceStyleManager.USE_EMBEDDED_FONT;
  61.       HtmlListboxCellRenderer.style_sheet = this.GetCSS();
  62.       HtmlTreeCellRenderer.style_sheet = this.GetCSS();
  63.       HtmlMenuCellRenderer.style_sheet = this.GetCSS();
  64.       EmbedHtmlMenuCellRenderer.style_sheet = this.GetCSS();
  65.    }
  66.    function GetPreviewCSS()
  67.    {
  68.       return this.mPreviewCSS;
  69.    }
  70.    function GetPrintCSS()
  71.    {
  72.       return this.mPrintCSS;
  73.    }
  74.    function GetCSS()
  75.    {
  76.       return this.mCSS;
  77.    }
  78. }
  79.